package cn.wetcland.es.controller;

import cn.wetcland.es.dto.TaskDoDTO;
import cn.wetcland.es.service.EsTaskService;
import cn.wetcland.es.utils.MyAssert;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;
import javax.servlet.http.HttpSession;

@Controller
@RequestMapping("/task")
public class TaskController {

    @Resource
    private EsTaskService taskService;

    @RequestMapping("/do")
    public String doTask(TaskDoDTO doDTO, HttpSession session) {
        MyAssert.verifyAlreadyLogin(session);
        taskService.doTask(doDTO, session);
        return "redirect:/";
    }

}
